﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

namespace Admin.NET.Application.Entity;
/// <summary>
/// WCS任务管理实体
/// </summary>
[SugarTable("wcstaskmanagement", TableDescription = "WCS任务表")]
// 唯一索引
[SugarIndex("uk_{table}", "TaskNumber", OrderByType.Asc, "OrderId", OrderByType.Asc, true)]
// 查询索引
[SugarIndex("index_{table}_name", "DownDate", OrderByType.Asc, "Status", OrderByType.Asc, false)]
// 查询索引：任务类型，状态
[SugarIndex("index_{table}_type", "Type", OrderByType.Asc, "Status", OrderByType.Asc, false)]

public class WCSTaskManagementEntity : EntityTenantBaseData
{
    /// <summary>
    /// 任务号
    /// </summary>
    [SugarColumn(ColumnDescription = "任务号", Length = 32, IsOnlyIgnoreUpdate = true)]
    public string TaskNumber { get; set; }

    /// <summary>
    /// 任务类型枚举
    /// </summary>
    [SugarColumn(ColumnDescription = "任务类型枚举", Length = 32)]
    public TaskTypeEnum Type { get; set; }

    /// <summary>
    /// 订单号
    /// </summary>
    [SugarColumn(ColumnDescription = "订单号", Length = 32)]
    public string OrderId { get; set; }

    /// <summary>
    /// 任务状态枚举
    /// </summary>
    [SugarColumn(ColumnDescription = "任务状态", Length = 32)]
    public TaskStatusEnmu Status { get; set; }

    /// <summary>
    /// 任务下发时间
    /// </summary>
    [SugarColumn(ColumnDescription = "下发时间")]
    public DateTime? DownDate { get; set; }

    /// <summary>
    /// 任务完成时间
    /// </summary>
    [SugarColumn(ColumnDescription = "完成时间")]
    public DateTime? FinishDate { get; set; }

    /// <summary>
    /// 暂存渠道
    /// </summary>
    [SugarColumn(ColumnDescription = "暂存渠道", Length = 32, IsNullable = true)]
    public virtual string Channel { get; set; }

    /// <summary>
    /// 发送次数
    /// </summary>
    [SugarColumn(ColumnDescription = "发送次数", Length = 32, IsNullable = true)]
    public virtual int CountNumber { get; set; }

    /// <summary>
    /// 响应结果
    /// </summary>
    [SugarColumn(ColumnDescription = "响应结果", Length = 32, IsNullable = true)]
    public virtual string ResPonse { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [SugarColumn(ColumnDescription = "是否启用", DefaultValue = "1")]
    public WStatusEnum Isenable { get; set; } = WStatusEnum.Enable;

    /// <summary>
    /// 排序id任务优先级
    /// </summary>
    [SugarColumn(ColumnDescription = "下发后排序优先级id")]
    public int SortId { get; set; }

    /// <summary>
    /// 出入库口
    /// </summary>
    [SugarColumn(ColumnDescription = "出入库口")]
    public string? HoistOpening { get; set; }

    /// <summary>
    /// 库位
    /// </summary>
    [SugarColumn(ColumnDescription = "库位")]
    public string? Loc { get; set; }

    /// <summary>
    /// 托盘码
    /// </summary>
    [SugarColumn(ColumnDescription = "托盘码")]
    public string? TrayCode { get; set; }

    /// <summary>
    /// SN码
    /// </summary>
    [SugarColumn(ColumnDescription = "SN码", Length = 32, IsNullable = true)]
    public virtual string SN { get; set; }

    /// <summary>
    /// 物料编码
    /// </summary>
    [SugarColumn(ColumnDescription = "物料编码")]
    public string? MaterialCode { get; set; }

}
